<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <!-- <script src="http://150.158.14.110:8080/public/website/list"></script> -->
</head>

<body>
    <script>
        // 一个方法传了两个回调函数，那么就与Promise相关
        axios.interceptors.request.use(function (config) {
            console.log(1);

            return config;
        }, function (error) {
            console.log(0);

            return Promise.reject(error);
        });

        axios.interceptors.response.use(function (response) {
            console.log(1);

            return response;
        }, function (error) {
            console.log(0);

            return Promise.reject(error);
        });

        axios.get('http://150.158.14.110:8080/public/website/list')
            .then(response => {
                console.log(response.data);
            })
    </script>
</body>

</html>